﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ThaireInvestmentWeb.WcfSerivce;

namespace ThaireInvestmentWeb.Models
{
    public class DepositTransactionAdapter
    {
        private readonly DepositHeaderDTO _header;
        private readonly DepositTransaction _data;
        public DepositTransactionAdapter(DepositTransaction data, DepositHeaderDTO header)
        {
            _data = data;
            _header = header;
        }

        public string Link
        {
            get
            {
                string method = "EditDepositTransaction";
                if (TransactionType.Trim() == "Withdraw")
                    method = "EditDepositWithdrawTransaction";
                if (TransactionType.Trim() == "Guarantee")
                    method = "EditDepositGuaranteeTransaction";
                return string.Format("{0}?transactionId={1}", method, _data.DepositTransactionID);
            }
        }

        public int ID
        {
            get { return _data.DepositTransactionID; }
        }
        // TRANSACTION_TYPE
        public string TransactionType
        {
            get { return _data.TransactionType; }
        }
        // REF_NO
        public string DepositType
        {
            get { return _header.DepositType; }
        }

        public string AccountVoucherNO
        {
            get { return _header.Header.AccountVoucherNO; }
        }

        public string BankName
        {
            get { return _header.Header.BankName; }
        }


        // TYPEOFPAYMENT_ID
        public int? TypeofpaymentID
        {
            get { return _data.TypeofpaymentID; }
        }
        // TRADE_DATE
        public DateTime? TradeDate
        {
            get { return _data.TradeDate; }
        }
        // SETTLEMENT_DATE
        public DateTime? SettlementDate
        {
            get { return _data.SettlementDate; }
        }
        // UNIT
        public int? Unit
        {
            get { return _data.Unit; }
        }
        //REF_NO
        public string RefNO
        {
            get { return _data.RefNO; }
        }
        
    }
}